{extend name="../../admin/view/main"}

{block name='content'}
<form action="{:request()->url()}" autocomplete="off" class="layui-form layui-card" data-auto="true" method="post">
    <div class="layui-card-body padding-40">

        <label class="layui-form-item relative block">
            <span class="color-green font-w7">名称</span>
            <span class="color-desc margin-left-5">Banner Title</span>
            <input class="layui-input" name="title" placeholder="请输入名称" required value='{$data.title|default=""}'>
        </label>
        <div class="layui-form-item relative block">
            <span class="color-green font-w7">封面图</span>
            <span class="color-desc margin-left-5">Image</span>
            <br>
            <input type="hidden" name="image" value="{$data.image|default=''}">
            <script>$('[name=image]').uploadOneImage()</script>
            <br>
        </div>
        <div class="layui-form-item relative block">
            <span class="color-green font-w7">是否热门</span>
            <span class="color-desc margin-left-5">HotType</span>
            <select class="layui-select" lay-search name="is_hot">
                <option value="">--- 是否热门 ---</option>
                {foreach ["否", "是"] as $k => $t}
                {eq name='$data.is_hot|default="0"' value='$k'}
                <option selected value="{$k}">{$t|default=''}</option>
                {else}
                <option value="{$k}">{$t|default=''}</option>
                {/eq}
                {/foreach}
            </select>
        </div>
        <div class="layui-form-item relative block">
            <span class="color-green font-w7">收费类型</span>
            <span class="color-desc margin-left-5">Type</span>
            <select class="layui-select" lay-search name="type">
                <option value="">--- 收费类型 ---</option>
                {foreach ["免费", "收费"] as $k => $t}
                {eq name='$data.type|default="0"' value='$k'}
                <option selected value="{$k}">{$t|default=''}</option>
                {else}
                <option value="{$k}">{$t|default=''}</option>
                {/eq}
                {/foreach}
            </select>
        </div>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">收费价格</span>
            <span class="color-desc margin-left-5">price</span>
            <input class="layui-input" name="price" placeholder="{$data.price|default='收费价格'}" value="{$data.price|default=''}"/>
            <span class="help-block">请填写收费价格，免费请输入0或不填</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">主办方</span>
            <span class="color-desc margin-left-5">sponsor</span>
            <input class="layui-input" name="sponsor" placeholder="{$data.sponsor|default='主办方'}" value="{$data.sponsor|default=''}"/>
            <span class="help-block">请填写主办方</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">活动地址</span>
            <span class="color-desc margin-left-5">address</span>
            <input class="layui-input" name="address" placeholder="{$data.address|default='活动地址'}" value="{$data.address|default=''}"/>
            <span class="help-block">请填写活动地址</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">联系方式</span>
            <span class="color-desc margin-left-5">contact</span>
            <input class="layui-input" name="contact" placeholder="{$data.contact|default='联系方式'}" value="{$data.contact|default=''}"/>
            <span class="help-block">请填写联系方式</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">限制人数</span>
            <span class="color-desc margin-left-5">contact</span>
            <input class="layui-input" name="person" type="number" placeholder="{$data.person|default='限制人数'}" value="{$data.person|default=''}"/>
            <span class="help-block">请填写限制人数，请填写整数</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">活动开始时间</span>
            <span class="color-desc margin-left-5">time</span>
            <input class="layui-input" name="time" placeholder="{$data.time|default=''}" value="{$data.time|default=''}"/>
            <span class="help-block">请填写活动开始时间，时间格式如2022-01-01 12:01:01</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">活动结束时间</span>
            <span class="color-desc margin-left-5">time</span>
            <input class="layui-input" name="end_time" placeholder="{$data.end_time|default=''}" value="{$data.end_time|default=''}"/>
            <span class="help-block">请填写活动结束时间，时间格式如2022-01-01 12:01:01</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">注意事项</span>
            <span class="color-desc margin-left-5">matter</span>
            <textarea placeholder="请输注意事项" class="layui-textarea" name="matter">{$data.matter|default=""}</textarea>
            <span class="help-block"><b>必填，</b>请输注意事项</span>
        </label>
        <div class="layui-form-item relative block">
            <span class="color-green font-w7 label-required-prev">内容</span>
            <span class="color-desc margin-left-5">Page Content</span>
            <label class="relative block">
                <textarea class="layui-hide" name="content">{$data.content|default=''}</textarea>
            </label>
        </div>

        <div class="hr-line-dashed"></div>

        <div class="layui-form-item text-center">
            <button class="layui-btn" type="submit">保存数据</button>
            <button class="layui-btn layui-btn-danger" data-confirm="确定要取消编辑吗？" data-history-back type='button'>取消编辑</button>
        </div>
    </div>

</form>

<script>
    layui.form.render();
    require(['ckeditor'], function () {
        window.createEditor('[name=content]', {height: 500});
    });
</script>
{/block}